package com.edgclub.edg.utils.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**
 * 贴子信息存储
 * 
 *
 */
public class TopicPrefUtils {

	private static final String GUZHITOPIC = "gz_topic_pref";

	private Context mContext;

	private SharedPreferences topicPref;

	private Editor topicEditor;

	public TopicPrefUtils(Context mContext) {
		this.mContext = mContext;
		topicPref = mContext.getSharedPreferences(GUZHITOPIC,
				Context.MODE_PRIVATE);
		topicEditor = topicPref.edit();
	}

	/**
	 * 获取附近的贴子数据
	 *
	 * @return
	 */
	public String getNearByTopicData() {
		return topicPref.getString("nearbydata", "");
	}

	/**
	 * 存储附近的贴子数据
	 *
	 * @param isEmsemob
	 */
	public void setNearByTopicData(String data) {
		topicEditor.putString("nearbydata", data);
		topicEditor.commit();
	}

	/**
	 * 获取我的贴子数据
	 *
	 * @return
	 */
	public String getMyTopicData() {
		return topicPref.getString("mydata", "");
	}

	/**
	 * 存储我的贴子数据
	 *
	 * @param isEmsemob
	 */
	public void setMyTopicData(String data) {
		topicEditor.putString("mydata", data);
		topicEditor.commit();
	}

	/**
	 * 获取关注我的贴子数据
	 *
	 * @return
	 */
	public String getAtMeData() {
		return topicPref.getString("likeme", "");
	}

	/**
	 * 存储关注我的贴子数据
	 *
	 * @param isEmsemob
	 */
	public void setAtMeData(String data) {
		topicEditor.putString("likeme", data);
		topicEditor.commit();
	}


	/**
	 * 获取帖子频道
	 *
	 * @return
	 */
	public String getTopicChannel() {
		return topicPref.getString("topicchannel", "");
	}

	/**
	 * 存储帖子频道
	 * @param data
	 */
	public void seTopicChannel(String data) {
		topicEditor.putString("topicchannel", data);
		topicEditor.commit();
	}
	/**
	 * 获取约黑提醒状态
	 *
	 * @return
	 */
	public Boolean getTopicYuehei() {
		return topicPref.getBoolean("topicyuehei",false);
	}

	/**
	 * 存储约黑提醒状态
	 * @param data
	 */
	public void setTopicYuehei(Boolean b) {
		topicEditor.putBoolean("topicyuehei", b);
		topicEditor.commit();
	}



}
